package com.kly.user.db.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.kly.user.db.dao.UserRelationDao;
import com.kly.user.db.entity.UserRelationEntity;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* User: linqu
* Date: 2023-05-24
* Time: 10:10:36.892
*/

@Repository
public class UserRelationDaoImpl extends AbstractBaseMapper<UserRelationEntity> implements UserRelationDao {

    /**
     * 修改用户信息
     * @param userRelationEntity
     * @return
     */
    @Override
    public int updateByUserCode(UserRelationEntity userRelationEntity) {
        return getSqlSession().update(this.getStatement("updateByUserCode"), userRelationEntity);
    }

    /**
     * 获取wlm列表
     * @param entity
     * @return
     */
    @Override
    public List<UserRelationEntity> queryUserRelationByFriendUserCode(UserRelationEntity entity) {
        return this.getSqlSession().selectList(this.getStatement("queryUserRelationByFriendUserCode"), entity);
    }

    /**
     * 获取wlm数量
     * @param entity
     * @return
     */
    @Override
    public int queryUserRelationNum(UserRelationEntity entity) {
        return (Integer)this.getSqlSession().selectOne(this.getStatement("queryUserRelationNum"), entity);

    }
}